package com.sptpc.learspring.model;

import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

@Entity
@Table(name = "t_category")
@Getter
@Setter
//@Data
//@ToString(callSuper = true)
//@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor  //为Java类自动生成全参数构造函数
@NoArgsConstructor  //为Java类自动生成无参构造函数
@Builder  //创建对象时可采用链式写法
public class Category extends BaseEntity implements Serializable {
    private String name;
//    @OneToMany(mappedBy = "category")
//    private List<Drink> drinks;

    @Override
    public String toString() {
        return "Category{" +
                "name='" + name + '\'' +
//                ", drinks=" + drinks +
                "} ";
    }
}
